package ru.ksu.ktk.diploma.sdi.mapping;

import java.util.ArrayList;
import java.util.List;

public class Correspondence {
    private String sourceClassUri;
    private List<MappingElement> mappingElements = new ArrayList<MappingElement>();

    public Correspondence(String sourceClassUri) {
        this.sourceClassUri = sourceClassUri;
    }

    public String getSourceClassUri() {
        return sourceClassUri;
    }

    public void setSourceClassUri(String sourceClassUri) {
        this.sourceClassUri = sourceClassUri;
    }

    public List<MappingElement> getMappingElements() {
        return mappingElements;
    }

    public void setMappingElements(List<MappingElement> mappingElements) {
        this.mappingElements = mappingElements;
    }

    public void addMappingElement(MappingElement mappingElement) {
        this.mappingElements.add(mappingElement);
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof Correspondence)) return false;
        Correspondence corr = (Correspondence) o;
        return sourceClassUri.equals(corr.getSourceClassUri());
    }
}
